package db;

// import graphics.edit.EditJFrame;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import javax.swing.JFrame;

// import org.h2.jdbc.JdbcSQLException;

// import core.Message;

public class DBConnection {

	Connection con;
	
	public DBConnection() throws SQLException {
		
		try {
			Class.forName("org.h2.Driver");
		} catch (ClassNotFoundException e) {
			
			e.printStackTrace();
			//Message errorMessage = new Message(new EditJFrame());
			//errorMessage.customError("ERR002: Problemi di connessione al Database", "ERR002: Problemi di connessione al database");
		}
		con = DriverManager.getConnection("jdbc:h2:file:.//DB/database", "sa", "");
		
		
	}

	public Connection getCon() {
		return con;
	}
	
}